package com.bmps.springcloud.insuredmicroservice.callback.accept;

import com.bmps.springcloud.common.response.TaskResponseModel;
import com.bmps.springcloud.insuredmicroservice.callback.AbstractCallBack;
import com.bmps.springcloud.insuredmicroservice.model.accept.resquest.RequestModel;
import com.bmps.springcloud.insuredmicroservice.service.underwrite.AcceptService;

import java.util.List;

/**
 * description:
 * 校验冲突信息
 *
 * @author jackdaw
 * @date 2020-07-29 16:05
 */
public class CheckConflictCallBack extends AbstractCallBack<TaskResponseModel> {

    private final AcceptService acceptService;

    public CheckConflictCallBack(Object... args) {
        super((String) args[0], (List<Object>) args[1]);
        this.acceptService = (AcceptService) args[2];
    }

    @Override
    public TaskResponseModel call() throws Exception {
        return acceptService.checkConflict(key, (RequestModel) params.get(0));
    }
}
